<template>
	<view >
	
		<view>
		   			<!-- 插入模式 -->
		   	<uni-calendar class="uni-calendar--hook" :selected="info.selected" :showMonth="false" @change="change" @monthSwitch="monthSwitch" />

		</view>
	</view>
</template>

<script>
	import dormitory from '@/api/modules/dormitory'
	import {parseTime} from "@/utils/date.js"
	export default {
		data() {
			return {
				    operateType: '',
					loginId: '',
					userName: '',
					topName: '',
					userId: '',
					info: {
						lunar: true,
						range: true,
						insert: false,
						selected: []
								
				}
			}
		},
		methods: {
			change(e) {
				console.log(e)
				// 跳转到汇总页面 传时间
				var dateTime = e.fulldate
				uni.navigateTo({
					url:`/pages_duty/classTeacher/dormitoryAttence/dormitoryAttenceSummary?userId=${this.userId}&dateTime=${dateTime}&operateType=${this.operateType}`
				})
			
	
			}
		},
		onLoad(options) {
			uni.getStorage({
				key: "loginName",
				success: (res) => {
					this.userName = res.data//获取用户姓名
				}
			})
			this.operateType = options.type;
			var loginId = uni.getStorageSync("loginId");
			this.loginId = loginId;
			this.userId = loginId;
			this.topName = "日期选择"
			console.log(this.userId)
		}
		}
</script>
	
<style>
.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	},
	.title{
		font-size: 18rpx;
		font-weight: bolder;
	}
</style>